package com.ermax.aircond.manage.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;

import com.ermax.aircond.common.domain.CommonDomain;
import com.ermax.aircond.maintain.domain.Machine;

@Entity
@Audited(targetAuditMode=RelationTargetAuditMode.NOT_AUDITED)
@Table(name="SCHEDULE_TERM")
public class ScheduleTerm extends CommonDomain implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="SCHEDULE_ID")
	private long id;
	
	private short nid;
	private String cmd;
	
	@Type(type = "yes_no")
	private boolean active = false;
	
	@Type(type = "yes_no")
	private boolean execMon = false;
	@Type(type = "yes_no")
	private boolean execTue = false;
	@Type(type = "yes_no")
	private boolean execWed = false;
	@Type(type = "yes_no")
	private boolean execThu = false;
	@Type(type = "yes_no")
	private boolean execFri = false;
	@Type(type = "yes_no")
	private boolean execSat = false;
	@Type(type = "yes_no")
	private boolean execSun = false;
		
	private String scheduleHour = null;
	private String scheduleMin = null;
	
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastExecuteTime = null;
	
	@ManyToOne(fetch=FetchType.LAZY)
	private Machine machine;

	@Type(type = "yes_no")
	private boolean start = false;	
	private String temperature = "";	
	private String minimumTemperature = "";
		
	private String fanSpeed = "";
	private String keyLock = "";
	private String errorMessage = "";
	
	//dummy
	private String windValue = "";
	//dummy
	private String controlMode = "";
	//dummy	
	private String Unmonitored = "";
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public short getNid() {
		return nid;
	}
	public void setNid(short nid) {
		this.nid = nid;
	}
	public String getCmd() {
		return cmd;
	}
	public void setCmd(String cmd) {
		this.cmd = cmd;
	}
	public boolean isActive() {
		return active;
	}
	public void setActive(boolean active) {
		this.active = active;
	}
	public boolean isExecMon() {
		return execMon;
	}
	public void setExecMon(boolean execMon) {
		this.execMon = execMon;
	}
	public boolean isExecTue() {
		return execTue;
	}
	public void setExecTue(boolean execTue) {
		this.execTue = execTue;
	}
	public boolean isExecWed() {
		return execWed;
	}
	public void setExecWed(boolean execWed) {
		this.execWed = execWed;
	}
	public boolean isExecThu() {
		return execThu;
	}
	public void setExecThu(boolean execThu) {
		this.execThu = execThu;
	}
	public boolean isExecFri() {
		return execFri;
	}
	public void setExecFri(boolean execFri) {
		this.execFri = execFri;
	}
	public boolean isExecSat() {
		return execSat;
	}
	public void setExecSat(boolean execSat) {
		this.execSat = execSat;
	}
	public boolean isExecSun() {
		return execSun;
	}
	public void setExecSun(boolean execSun) {
		this.execSun = execSun;
	}
	public String getScheduleHour() {
		return scheduleHour;
	}
	public void setScheduleHour(String scheduleHour) {
		this.scheduleHour = scheduleHour;
	}
	public String getScheduleMin() {
		return scheduleMin;
	}
	public void setScheduleMin(String scheduleMin) {
		this.scheduleMin = scheduleMin;
	}
	public Date getLastExecuteTime() {
		return lastExecuteTime;
	}
	public void setLastExecuteTime(Date lastExecuteTime) {
		this.lastExecuteTime = lastExecuteTime;
	}
	public Machine getMachine() {
		return machine;
	}
	public void setMachine(Machine machine) {
		this.machine = machine;
	}
	public boolean isStart() {
		return start;
	}
	public void setStart(boolean start) {
		this.start = start;
	}
	public String getTemperature() {
		return temperature;
	}
	public void setTemperature(String temperature) {
		this.temperature = temperature;
	}
	public String getWindValue() {
		return windValue;
	}
	public void setWindValue(String windValue) {
		this.windValue = windValue;
	}
	public String getFanSpeed() {
		return fanSpeed;
	}
	public void setFanSpeed(String fanSpeed) {
		this.fanSpeed = fanSpeed;
	}
	public String getControlMode() {
		return controlMode;
	}
	public void setControlMode(String controlMode) {
		this.controlMode = controlMode;
	}
	public String getUnmonitored() {
		return Unmonitored;
	}
	public void setUnmonitored(String unmonitored) {
		Unmonitored = unmonitored;
	}
	public String getMinimumTemperature() {
		return minimumTemperature;
	}
	public void setMinimumTemperature(String minimumTemperature) {
		this.minimumTemperature = minimumTemperature;
	}
	public String getKeyLock() {
		return keyLock;
	}
	public void setKeyLock(String keyLock) {
		this.keyLock = keyLock;
	}
	public String getErrorMessage() {
		return errorMessage;
	}
	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
	

}
